package cn.txun.springboot32.mapper;

import cn.txun.springboot32.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper {
    //根据用户名查询用户信息
    @Select("select password from user where username=#{username}")
    User selectByUsername(User user);

    //注册用户信息
    @Insert("insert into user values(null,#{username},#{password},#{nickname})")
    int insert(User user);

}
